<div id="leftsidebar">

<h2><div id='context_title'><%= render :partial=>"layouts/context_title", :locals => {:context_present=>@context_present}%></div></h2>
<div id="context"  onclick="add_selected_to_context()">
<%= render :partial=>"layouts/context" %>
</div>

<div id='context_spinner' style='display:none; float:right;'>loading ...</div>

<%= drop_receiving_element('context',
		:accept => 'list_item',
		:complete => "$('context_spinner').hide();" ,
		:before => "$('context_spinner').show();" ,
		:hoverclass => 'hover',
		:with => "'list_item=' + encodeURIComponent(element.id.split('_').last())" ,
		:url => {:controller=>'artifacts', :action=>'add_context'})%>

<% if @lefthand_components %>
<%i=1%>
<% for component in @lefthand_components %>
<div id='lhs_component<%=i%>'>
  <%= render_component(component) %>
</div>
<%i=i+1%>
<% end %>
<% end %>

<%if @searchtitle%>
    <div class="searchbox">
        <%= form_tag({:controller => @search_controller || params[:controller],:action => "search", :id => @search_id,:resource_id => nil},{:method=>'get'}) %>
            <%=@searchtitle %><br>
            <% if !params[:search_terms].nil? and params[:search_terms].size > 1 %>
                <input type="text" name="search_terms" value="<%= params[:search_terms] %>" size="15" maxlength="60" class="sidebar"/>
            <% else %>
                <input type="text" name="search_terms" value="" size="15" maxlength="60" class="sidebar" />
            <% end %>
	    <br>
	    <%= submit_tag 'Search', {:class=>'sidebar'} %>
      <%= end_form_tag%>
    </div> <!-- class="searchbox" -->
<% end %>


<%if @lhs_links%>
  <div class="options">
    <ul>
<%for link in @lhs_links%>
    <li>
      <%= link_to (link['icon'] == nil ? '':(lilt_image_tag("/images/#{link['icon']}",:border=>0))) + link['title'], link['url'] %>
    </li>
<%end%>
    </ul>
  </div> <!-- class="options" -->
<%end%>

</div> <!-- id="leftsidebar" -->